// router/index.ts ----------------创建路由------------------
import { createRouter, createWebHistory } from "vue-router";
import { routes } from "./config";
import { message } from 'ant-design-vue'

const router = createRouter({
  history: createWebHistory(),
  routes
})
router.beforeEach((to) => {
  // to.path = '/login'
  let remark = localStorage.getItem('remark') || ''
  if (to.name !== "liveList" && to.name !== "login" && remark) {
    message.warn('你没有该页面权限')
    return false
  }
  return true
})
export default router
